
 <?php

session_start();

require_once($_SERVER['DOCUMENT_ROOT'].'/incofarming/Functions/config.php');
require_once($_SERVER['DOCUMENT_ROOT'].'/incofarming/Functions/class/admin_model.php');

$admin = new Dashboard_admin();

if(isset($_GET['tambah-kop'])){
	$admin->add_koperasi();
	
	//header('Location: /incofarming/Views/admin/dashboard-admin_view.php');
} else {
	$admin->set_view();
	//header('Location: /incofarming/Views/admin/dashboard-admin_view.php');
}

class Dashboard_admin{
	private $id_user;
	private $admin_model;
	
	function __construct(){
		$this->id_user = $_SESSION['id_user'];
		$this->admin_db = new Admin_model();
	}
	
	function set_view(){
		include($_SERVER['DOCUMENT_ROOT'].'/incofarming/Views/admin/dashboard-admin_view.php');
	}
	
	function add_koperasi(){
		header('Location: /incofarming/Functions/admin/register-koperasi.php');
	}
}

?>

